#include "eyes.h"
#include "ui_eyes.h"
#include<QScreen>

Eyes::Eyes(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::Eyes)
{
    ui->setupUi(this);

    QScreen *screen = QGuiApplication::primaryScreen ();
    QRect mm = screen->availableGeometry() ;

    int x = mm.width();
    x >>= 2;
    //x += 240;
    setGeometry(x, 0, 480, 120);
}

Eyes::~Eyes()
{
    delete ui;
}

void Eyes::on_pushButton_clicked()
{
    this->hide();
}

void Eyes::closeEvent(QCloseEvent* event)
{
    this->hide();	 // 隐藏窗口
    event->ignore(); // 忽视原来的关闭事件
}
